/** @file               sw_ini.h
 *  @copyright          Copyright (C) 2006-2026 flyfish (tenggui_fu@126.com)
 *  @brief              This file is part of the swallow library
 *  @author             $Author: flyfish $
 *  @version            $Rev: 385 $
 *  @date               $Date: 2016-12-22 00:12:05 +0800 (周四, 22 12月 2016) $
 */
#ifndef __SW_INI_H__
#define __SW_INI_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef SW_VOID             *SW_INI;
#define SW_INVALID_INI      NULL

SW_API SW_RET SW_InitIniAPI(SW_VOID);
SW_API SW_RET SW_RunIniAPI(SW_VOID);
SW_API SW_RET SW_StopIniAPI(SW_VOID);
SW_API SW_RET SW_ExitIniAPI(SW_VOID);
SW_API SW_INI SW_OpenIni(const SW_CHAR *pFileName);
SW_API SW_INI SW_CreateIni(SW_VOID);
SW_API SW_RET SW_CloseIni(SW_INI ini);
SW_API SW_RET SW_SaveIni(SW_INI ini, const SW_CHAR *pFileName);
SW_API SW_UINT32 SW_GetIniSectionIndex(SW_INI ini, const SW_CHAR *pSection);
SW_API SW_UINT32 SW_GetIniKeyIndex(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_UINT32 SW_GetIniSectionCount(SW_INI ini);
SW_API SW_UINT32 SW_GetIniKeyCount(SW_INI ini, const SW_CHAR *pSection);
SW_API SW_RET SW_GetIniSection(SW_INI ini, SW_UINT32 index, SW_CHAR *pSection, SW_UINT32 sectionLen);
SW_API SW_RET SW_GetIniKey(SW_INI ini, const SW_CHAR *pSection, SW_UINT32 index, SW_CHAR *pKey, SW_UINT32 keyLen);
SW_API SW_RET SW_DeleteIniSection(SW_INI ini, const SW_CHAR *pSection);
SW_API SW_RET SW_DeleteIniKey(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);

SW_API SW_RET SW_GetIniStr(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_CHAR *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_SetIniStr(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_CHAR *pValue);
SW_API SW_BOOL SW_GetIniBool(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniBool(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_BOOL value);
SW_API SW_INT8 SW_GetIniInt8(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniInt8(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT8 value);
SW_API SW_UINT8 SW_GetIniUInt8(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniUInt8(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT8 value);
SW_API SW_INT16 SW_GetIniInt16(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniInt16(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT16 value);
SW_API SW_UINT16 SW_GetIniUInt16(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniUInt16(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT16 value);
SW_API SW_INT32 SW_GetIniInt32(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniInt32(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT32 value);
SW_API SW_UINT32 SW_GetIniUInt32(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniUInt32(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT32 value);
SW_API SW_INT64 SW_GetIniInt64(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniInt64(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT64 value);
SW_API SW_UINT64 SW_GetIniUInt64(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniUInt64(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT64 value);
SW_API SW_FLOAT SW_GetIniFloat(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniFloat(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_FLOAT value);
SW_API SW_DOUBLE SW_GetIniDouble(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey);
SW_API SW_RET SW_SetIniDouble(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_DOUBLE value);
SW_API SW_RET SW_GetIniArrayBool(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_BOOL *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayBool(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_BOOL *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayInt8(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT8 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayInt8(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_INT8 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayUInt8(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT8 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayUInt8(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_UINT8 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayInt16(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT16 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayInt16(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_INT16 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayUInt16(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT16 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayUInt16(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_UINT16 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayInt32(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT32 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayInt32(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_INT32 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayUInt32(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT32 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayUInt32(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_UINT32 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayInt64(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT64 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayInt64(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_INT64 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayUInt64(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT64 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayUInt64(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_UINT64 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayFloat(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_FLOAT *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayFloat(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_FLOAT *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayDouble(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_DOUBLE *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayDouble(SW_INI ini, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_DOUBLE *pValue, SW_UINT32 valueLen);

SW_API SW_RET SW_GetIniStrDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_CHAR *pDefValue, SW_CHAR *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_SetIniStrDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_CHAR *pValue);
SW_API SW_BOOL SW_GetIniBoolDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_BOOL defValue);
SW_API SW_RET SW_SetIniBoolDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_BOOL value);
SW_API SW_INT8 SW_GetIniInt8Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT8 defValue);
SW_API SW_RET SW_SetIniInt8Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT8 value);
SW_API SW_UINT8 SW_GetIniUInt8Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT8 defValue);
SW_API SW_RET SW_SetIniUInt8Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT8 value);
SW_API SW_INT16 SW_GetIniInt16Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT16 defValue);
SW_API SW_RET SW_SetIniInt16Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT16 value);
SW_API SW_UINT16 SW_GetIniUInt16Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT16 defValue);
SW_API SW_RET SW_SetIniUInt16Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT16 value);
SW_API SW_INT32 SW_GetIniInt32Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT32 defValue);
SW_API SW_RET SW_SetIniInt32Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT32 value);
SW_API SW_UINT32 SW_GetIniUInt32Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT32 defValue);
SW_API SW_RET SW_SetIniUInt32Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT32 value);
SW_API SW_INT64 SW_GetIniInt64Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT64 defValue);
SW_API SW_RET SW_SetIniInt64Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT64 value);
SW_API SW_UINT64 SW_GetIniUInt64Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT64 defValue);
SW_API SW_RET SW_SetIniUInt64Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT64 value);
SW_API SW_FLOAT SW_GetIniFloatDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_FLOAT defValue);
SW_API SW_RET SW_SetIniFloatDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_FLOAT value);
SW_API SW_DOUBLE SW_GetIniDoubleDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_DOUBLE defValue);
SW_API SW_RET SW_SetIniDoubleDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_DOUBLE value);
SW_API SW_RET SW_SetIniArrayBoolDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_BOOL *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayBoolDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_BOOL *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayInt8Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_INT8 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayInt8Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT8 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayUInt8Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_UINT8 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayUInt8Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT8 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayInt16Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_INT16 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayInt16Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT16 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayUInt16Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_UINT16 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayUInt16Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT16 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayInt32Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_INT32 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayInt32Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT32 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayUInt32Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_UINT32 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayUInt32Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT32 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayInt64Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_INT64 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayInt64Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_INT64 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayUInt64Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_UINT64 *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayUInt64Direct(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_UINT64 *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayFloatDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_FLOAT *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayFloatDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_FLOAT *pValue, SW_UINT32 *pValueLen);
SW_API SW_RET SW_SetIniArrayDoubleDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, const SW_DOUBLE *pValue, SW_UINT32 valueLen);
SW_API SW_RET SW_GetIniArrayDoubleDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey, SW_DOUBLE *pValue, SW_UINT32 *pValueLen);

SW_API SW_RET SW_GetIniSectionDirect(const SW_CHAR *pFileName, SW_UINT32 index, SW_CHAR *pSection, SW_UINT32 sectionLen);
SW_API SW_RET SW_GetIniKeyDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, SW_UINT32 index, SW_CHAR *pKey, SW_UINT32 keyLen);
SW_API SW_RET SW_DeleteIniSectionDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection);
SW_API SW_RET SW_DeleteIniKeyDirect(const SW_CHAR *pFileName, const SW_CHAR *pSection, const SW_CHAR *pKey);

#ifdef __cplusplus
}
#endif

#endif

